<!DOCTYPE html>
<html>

<head>
<title>添加代理</title>
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">

<%include("/common/include.html"){}%>
<style>
	.required{
		display:inline-block;
		width: 30%;
	}
	.requiredx{
		display:inline-block;
		width: 89%;
	}
	label{
		text-align:right;
		width:70px;
		display:inline-block;
	}
</style>
<style type="text/css">
</style>
</head>

<body>
	<div class="easyui-panel" style="width: 100%; padding: 30px 60px; border-width: 0px;">
		<div  style="margin:auto;width:770px">
			<form id="addPlate" method="post" class="form">
				<div style="margin-bottom: 20px">
					<label class="label-top">型号:</label>
					<div class="required">
						<input id = "model" class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.model">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">品牌:</label>
					<div class="required">
						<input id = "pp" class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.pp">
					</div>
					<span style="color:red">*必填项</span> 
				</div>
				
				
				<div style="margin-bottom: 20px">
					<label class="label-top">类型:</label>
					<div class="required">
					<select name="vehicleInformation.type" class="easyui-combobox theme-textbox-radius"  data-options="editable: false"  style="width: 100%;">
						 <option>电动车自行车</option>
						<option>电动二轮车</option>
						<option>电动轮椅车</option>
						<option>电动三轮车</option>
						<option>小型低速电动汽车</option> 
						</select>
						
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">生产厂家:</label>
					<div class="required">
						<input id = "manufacturer"  class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.manufacturer">
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
					<div style="margin-bottom: 20px">
					<label class="label-top">生产日期:</label>
					<div class="required">
						<input id = "birthday"  class="easyui-datebox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.birthday" >
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">是否国产:</label>
					<div class="required">
						<select name="vehicleInformation.imports"   style="width: 100%;" class="easyui-combobox theme-textbox-radius"  data-options="editable: false">
							<option value="国产">是</option>
							<option value="进口">否</option>
						</select>
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
				<div style="margin-bottom: 20px">
					<label class="label-top">制造国:</label>
					<div class="required">
						<input id = "manu_contry"  class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.manu_contry">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px" >车身质量:</label>
					<div class="required">
						<input id = "weight"  class="easyui-numberspinner inputBox theme-textbox-radius" labelposition="after"  style="width: 100%;" name="vehicleInformation.weight" data-options="increment:0.1,min:1,max:100000,precision:2,label:'公斤'" >
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
				<div style="margin-bottom: 20px">
					<label class="label-top">长:</label>
					<div class="required">
						<input id = "chang"  class="easyui-numberspinner inputBox theme-textbox-radius"  labelposition="after" style="width: 100%;" name="vehicleInformation.chang" data-options="increment:0.1,min:1,max:100000,precision:2,label:'cm'">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">宽:</label>
					<div class="required">
						<input id = "width"  class="easyui-numberspinner inputBox theme-textbox-radius" labelposition="after" style="width: 100%;" name="vehicleInformation.width" data-options="increment:0.1,min:1,max:100000,precision:2,label:'cm'">
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
				<div style="margin-bottom: 20px">
					
					<label class="label-top" >高:</label>
					<div class="required">
						<input id = "height"  class="easyui-numberspinner inputBox theme-textbox-radius" labelposition="after" style="width: 100%;" name="vehicleInformation.height" data-options="increment:0.1,min:1,max:100000,precision:2,label:'cm'" >
					</div>
					<span style="color:red">*必填项</span>
				
					<label class="label-top" style="margin-left:30px">颜色:</label>
					<div class="required">
					
					<select name="vehicleInformation.color"   style="width: 100%;" class="easyui-combobox theme-textbox-radius" data-options="editable: false" >
							<option>红色</option>
      					<option>白色</option>
      					<option>黑色</option>
      					<option>粉色</option>
      					<option>绿色</option>
      					<option>蓝色</option>
      					<option>橙色</option>
      					<option>紫色</option>
      					<option>黄色</option>
      					<option>棕色</option>
      					<option>其他</option>
						</select>
					</div>
					<span style="color:red">*必填项</span>
					
				</div>
				
				
				<div style="margin-bottom: 20px">
					<label class="label-top" >功率:</label>
					<div class="required">
					
					
						<input id = "gl"  class="easyui-numberspinner inputBox theme-textbox-radius numberspinner-f numberbox-f textbox-f spinner-f" labelposition="after" style="width: 100%;" name="vehicleInformation.gl" data-options="increment:0.1,min:1,max:100000,label:'W'" >
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
				<div id="partVal" style="display: none;">
				
				</div>
				
			</form>
		</div>
	</div>
	
	<script type="text/javascript">
		function showPart() {
			$('#win').window('open');
		}
		//@ sourceURL=mmm.js
		var $form = $('#addPlate');

		var submitNow = function($dialog, $grid, $tree, $pjq) {
			$("#partVal").html($("#partText").html());
			var url = "${cxt!}/vehicleInformation/addVehicle";
			var model=$('#model').val();
			var pp=$('#pp').val();
			var manufacturer=$('#manufacturer').val();
			var birthday=$('#birthday').val();
			var manu_contry=$('#manu_contry').val();
			var weight=$('#weight').val();
			var chang=$('#chang').val();
			var width=$('#width').val();
			var height=$('#height').val();
			var gl=$('#gl').val();
			
			if(model==null||model==""|| (model.length>0 && model.trim().length == 0)){
				$.alert(parent.$, "型号不能为空！");
				return false;
			}
			if(pp==null|| pp==""||(pp.length>0 && pp.trim().length == 0)){
				$.alert(parent.$, "品牌不能为空！");
				return false;
			}
			if(manufacturer==null|| manufacturer==""||(manufacturer.length>0 && manufacturer.trim().length == 0)){
				$.alert(parent.$, "生产厂家不能为空！");
				return false;
			}
			if(birthday==null||birthday==""|| (birthday.length>0 && birthday.trim().length == 0)){
				$.alert(parent.$, "生产日期不能为空！");
				return false;
			}
			if(manu_contry==null||manu_contry==""|| (manu_contry.length>0 && manu_contry.trim().length == 0)){
				$.alert(parent.$, "制造国不能为空！");
				return false;
			}
			if(weight==null||weight.length==0){
				$.alert(parent.$, "车身质量不能为空！");
				return false;
			}
			if(chang==null||chang.length==0){
				$.alert(parent.$, "长不能为空！");
				return false;
			}
			if(width==null||width.length==0){
				$.alert(parent.$, "宽不能为空！");
				return false;
			}
			if(height==null||height.length==0){
				$.alert(parent.$, "高不能为空！");
				return false;
			}
			if(gl==null||gl.length==0){
				$.alert(parent.$, "功率不能为空！");
				return false;
			}
			$.post(url, sy.serializeObject($form), function(result) {
				if (result.code == '200') {
					$grid.datagrid('reload');
					$.slideMsg("添加成功！", $pjq);
					$dialog.dialog('destroy');
				} else {
					$.alert($pjq, result.msg);
				}
			}, 'json');
		};
		var submitForm = function($dialog, $grid, $tree, $pjq) {
			submitNow($dialog, $grid, $tree, $pjq);
			// 					$form.isValid(function(isValied){
			// 						if(isValied){
			// 							submitNow($dialog, $grid, $pjq);
			// 						}
			// 					});
		};

	</script>
</body>
</html>